<?php 
header("content-type:text/html;charset=utf-8");
$dsn = "mysql:host=127.0.0.1;dbname=goods;charset=utf8";
$pdo = new PDO($dsn,"root","root");
$sql = "select * from imports";
$st = $pdo->query($sql);
$data = $st->fetchAll(PDO::FETCH_ASSOC);
?>
<center>
	<table border="2">
	<a href="dc.php">导出</a>
		<tr>
			<td>编号</td>
			<td>姓名</td>
			<td>年龄</td>
			<td>薪资</td>
			<td>操作</td>
		</tr>
		<?php foreach ($data as $k => $v) { ?>
			<tr>
				<td><?php echo $v['id'] ?></td>
				<td><?php echo $v['uname'] ?></td>
				<td><?php echo $v['age'] ?></td>
				<td><?php echo $v['money'] ?></td>
				<td><a href="">修改</a> | <a href="delete.php?id=<?php echo $v['id'] ?>">删除</a></td>
			</tr>
		<?php } ?>
	</table>
</center>
